草庐IT

python scrapy无法启动项目

全部标签

ruby - Rmagick 无法读取字体

我有一段代码在我的Rails应用程序中的图像之上绘制文本,不久前,可能不得不升级到OSXYosemite,它在我的本地机器上读取字体时遇到问题(生产服务器工作正常)。我可以把它简化为这个例子:require'rvg/rvg'font='"/Users/xxxxxxxx/xxxx/app/assets/fonts/PTSans-Regular.ttf"'rvg=Magick::RVG.new(100,100)do|canvas|canvas.text(0,0,'mytext').styles(font:font)endrvg.draw我收到这个错误Magick::ImageMagickE

ruby-on-rails - MySQL2 gem 无法安装

长期以来,我一直在尝试在我的Ubuntu12.04服务器上安装Gitlab,在我运行bundleinstall之前一切顺利。它说它无法安装MySQL2,但没有给出原因或纠正措施。home/gitlab/gitlab$sudo-ugitlab-Hbundleinstall--deployment--withoutdevelopmenttestpostgresFetchinggemmetadatafromhttp://rubygems.org/.......Fetchinggemmetadatafromhttp://rubygems.org/..Usingrake(10.0.1)Using

ruby - 无法从 ruby​​gems.org 安装 'cocoapods' gem(不良响应后端读取错误)

当我在OSXMavericks上运行“geminstallcocoapods”时出现错误。$geminstallcocoapodsERROR:Couldnotfindavalidgem'cocoapods'(>=0),hereiswhy:Unabletodownloaddatafromhttps://rubygems.org/-badresponsebackendreaderror503(https://rubygems.global.ssl.fastly.net/quick/Marshal.4.8/cocoapods-0.27.1.gemspec.rz)ERROR:Possiblea

ruby-on-rails - "Expected string default value for ` --jbuilder `; got true (boolean)"新建rails项目出错

我正在开始一个新项目,现在已经做了很多次了。但是,这是我第一次遇到这个问题!我正常创建应用railsnewmyapp-dpostgresql我使用railsdb:create创建了数据库并运行了站点railss。一切正常,我看到了Rails欢迎/等待页面。现在我开始创建我的模型,例如railsgmodeluser。我明白了!Expectedstringdefaultvaluefor`--jbuilder`;gottrue(boolean)invokeactive_recordThename'User'iseitheralreadyusedinyourapplicationorreser

ruby-on-rails - Rails 希望我在每次更改时重新启动?

我的View按预期工作;每次我更改某些内容时,它都会立即反射(reflect)在页面上。但是每次我在controller、model或config中进行更改时,我都必须重新启动服务器才能显示。我用railss-edevelopment启动我的服务器,它说明了这一点:=>BootingPuma=>Rails4.1.8applicationstartingindevelopmentonhttp://0.0.0.0:3000=>Run`railsserver-h`formorestartupoptions=>Notice:serverislisteningonallinterfaces(0.

ruby-on-rails - ActionCable - 无法在生产环境中升级到 WebSocket

ActionCable在生产中不起作用。在开发中运行良好,但在生产中运行不佳。在Ubuntu14.04上使用Puma运行Nginx。我已经检查过redis-server已启动并正在运行。Rails-v5.0.0.1production.log:INFO--:StartedGET"/cable/"[non-WebSocket]for178.213.184.193at2016-11-2514:55:39+0100ERROR--:FailedtoupgradetoWebSocket(REQUEST_METHOD:GET,HTTP_CONNECTION:close,HTTP_UPGRADE:)

ruby - 无法安装 Nokogiri gem,找不到 "libxml/parser.h",但它在那里,为什么?

我尝试安装Nokogiri,但我总是遇到编译错误:checkingforlibxml/parser.h...***extconf.rbfailed***但是,我已经安装了它和所有其他依赖项。我尝试像这样给安装程序提示:%>geminstallnokogiri----with-xml2-lib=/usr/lib/--with-xml2-include=/usr/include/libxml2/...checkingforlibxml/parser.h...***extconf.rbfailed***...但它仍然没有安装:%>find/usr/include/-name"parser.h

ruby-on-rails - 无法在 Rails 上安装 pg gem

我正在尝试捆绑安装,但是由于某些奇怪的原因,pggem在安装时返回了以下错误:$geminstallpg-v'0.18.4'Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingpg:ERROR:Failedtobuildgemnativeextension./Users/username/.rvm/rubies/ruby-2.2.1/bin/ruby-r./siteconf20151221-23315-1tkv3fd.rbextconf.rbcheckingforpg_config...noNopg_c

ruby-on-rails - Bundler 将我的 gem 放在我的项目目录中

我在Ruby1.9.2上有一个运行良好的Rails3rc应用程序,但Bundler一直在我的项目目录中创建一个名为“bandsintown”的文件夹(bandsintown是我使用的gem)。据我所知,这个文件夹里有我所有的珍宝。我很确定这以前从未发生过。这是正常行为吗?我认为这可能会干扰正在运行的测试。我收到“命令失败,状态为(1)”错误,然后它多次提到“bandsintown”文件夹。我发现Bundler将文件夹命名为“bandsintown”很奇怪,即使我在gemfile中注释掉那个gem。那个文件夹中有一个“ruby”文件夹,“ruby”文件夹中有一个“1.9.1”文件夹。我不

ruby - 如何使用礼物?在 Ruby 项目中?

我写了一个脚本,它使用Rails对Ruby核心对象类的扩展,现在我想把它独立出来。除了重写这些,是否有任何库或扩展可以让我独立使用它们? 最佳答案 您不必运行Rails即可使用require'active_support/all'或者如果您只想要一个特定的扩展名,例如blank?用于字符串,那么就可以require'active_support/core_ext/string'我lookeduppresent?它实际上被定义为defpresent?!blank?end积极支持中的空白定义为defblank?respond_to?(: